<template>
  <div class="player-footer" v-footer>
    <div class="action-container">
      <div class="action-left">
        <button class="mode" data-mode="0">
          <i class="iconfont icon-weimingmingwenjianjia_xunhuan"></i>
        </button>
        <button class="prev">
          <i class="iconfont icon-shangyishou"></i>
        </button>
        <button class="play-pause" data-mode="0">
          <i class="iconfont icon-bofang"></i>
        </button>
        <button class="next">
          <i class="iconfont icon-xiayishuo"></i>
        </button>
      </div>
      <div class="play-info">
        <div class="song-info">
          <div class="song-mate">
            <a>{{currentData.cur.music_name}}</a>
            -
            <span>
              <a :title="currentData.cur.singer_name">{{currentData.cur.singer_name}}</a>
            </span>
            <!-- <span v-for="(item,index) in currentData.cur.ar" :key="index">
              <a :title="item.name">{{item.name}}</a>
              {{index+1 >= currentData.cur.ar.length ? "" : " / "}}
            </span> -->
          </div>
          <div class="current-time">
            <span>04:03</span>
            /
            <span>04:11</span>
          </div>
        </div>
        <div class="progress">
          <div class="progress-curr" data-progress="0"></div>
          <div class="progress-slider" data-progress="0"></div>
          <div class="progress-load"></div>
        </div>
      </div>
      <div class="action-right">
        <div class="volume-control">
          <span class="cp-volume-icon">
            <i class="iconfont icon-shengyin"></i>
          </span>
          <div class="cp-volume-container">
            <div class="cp-vol-inner">
              <div class="cp-volume" data-progress="30"></div>
              <div class="cp-volume-slider" data-progress="30"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

import footer from "./directives/footer"
export default {
    name:"playFooter",
    directives:{
        footer
    },
    props:{
        currentData:Object
    },
}

</script>

<style lang='scss' >
.player-footer {
  position: absolute;
  width: 100%;
  height: 110px;
  bottom: 0;
  z-index: 10;
  padding: 0 60px 0 120px;
  box-sizing: border-box;

  .action-container {
    position: relative;
    padding: 0 450px 0 240px;
    height: 100%;
    min-width: 510px;

    i {
      color: #3a3a3e;
      font-size: 32px;
    }
    .action-left {
      width: 240px;
      margin-top: 38px;
      position: absolute;
      left: -20px;

      & > button {
        margin: 0 7px;
        background: 0 0;
        border: none;
        color: #fff;
        cursor: pointer;
      }

      .play-pause {
        i {
          font-size: 38px;
        }
      }
    }
    .play-info {
      width: 100%;
      position: relative;
      top: 34px;
      .song-info {
        margin-bottom: 10px;
        padding-right: 90px;

        .song-mate {
          white-space: nowrap;
          text-overflow: ellipsis;
          overflow: hidden;
          span {
            color: #525252;
          }
        }
        .current-time {
          position: absolute;
          right: 0;
          top: 0;
          color: #525252;
        }
      }
      .progress {
        position: relative;
        height: 3px;
        background-color: #615f5f;
        cursor: pointer;
        .progress-curr {
          width: 0;
          height: 3px;
          position: absolute;
          top: 0;
          z-index: 1;
          background-color: $ThemeColor;
        }
        .progress-slider {
          position: absolute;
          z-index: 2;
          top: -6px;
          display: inline-block;
          width: 15px;
          margin-left: -7.5px;
          height: 15px;
          border-radius: 50%;
          background-color: $ThemeColor;
        }
        .progress-load {
          width: 0;
          height: 3px;
          background-color: #acacac;
          transition: width 0.1s;
          position: absolute;
          top: 0;
          left: 0;
        }
      }
    }
    .action-right {
      position: absolute;
      right: 0;
      color: #fff;
      width: 450px;
      padding-top: 10px;

      .volume-control {
        float: left;
        height: 20px;
        color: #fff;
        line-height: 20px;
        width: 152px;
        position: relative;
        top: 3px;
        margin-left: 20px;
        .cp-volume-icon {
          cursor: pointer;
          display: inline-block;
          height: 20px;
        }
        .cp-volume-container {
          position: absolute;
          width: 100px;
          height: 20px;
          top: 0;
          user-select: none;
          display: inline-block;
          margin-left: 7px;
          cursor: pointer;
          .cp-vol-inner {
            position: absolute;
            width: 100px;
            height: 4px;
            top: 9px;
            background-color: #848484;
            user-select: none;
            display: inline-block;
            .cp-volume {
              width: 50%;
              height: 4px;
              background-color: $ThemeColor;
              user-select: none;
              position: absolute;
            }
            .cp-volume-slider {
              position: absolute;
              top: 50%;
              margin: -5px 0px 0px -5px;
              right: 50%;
              width: 10px;
              height: 10px;
              border-radius: 50%;
              background-color: $ThemeColor;
              transition: width 0.1s;
              user-select: none;
            }
          }
        }
      }
    }
  }
}
</style>
